using System;
using System.Collections.Generic;

namespace Microsoft.Xna.Framework
{
	public class LaunchParameters : Dictionary<string, string>
	{
		public LaunchParameters()
		{
			//Todo
			//this.ParseCommandLineArguments(Environment.GetCommandLineArgs());
		}

		internal void ParseCommandLineArguments(string[] args)
		{
			char[] chArray = new char[2]
			                 	{
			                 		'/',
			                 		'-'
			                 	};
			string str1 = string.Empty;
			string str2 = string.Empty;
			string str3 = string.Empty;
			if (args.Length <= 1)
				return;
			for (int index = 1; index < args.Length; ++index)
			{
				string str4 = args[index];
				string key = string.Empty;
				string str5 = string.Empty;
				this.ParseKeyValuePair(str4.TrimStart(chArray), ref key, ref str5);
				if (!this.ContainsKey(key) && key != string.Empty)
					this.Add(key, str5);
			}
		}

		private void ParseKeyValuePair(string argument, ref string key, ref string value)
		{
			char ch = ':';
			string str = string.Empty;
			key = argument;
			value = string.Empty;
			int length = argument.IndexOf(ch);
			if (length == -1)
				return;
			key = argument.Substring(0, length);
			value = argument.Substring(length + 1);
		}
	}
}